1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 |
<?php
#*********************************************************************
# Description:
# To establish a connection to a database, a connection string as
# recognized by SQL Anywhere is passed into the sasql_connect()
# function. It returns a positive SQL Anywhere connection resource on
# success, or an error and 0 on failure.
#
#*********************************************************************
# Connect using the default user ID and password
# SQL Anywhere connection string
$conn = sasql_connect ( "UID=DBA;PWD=sql" )
if ( ! $conn ) {
echo "Connection failed \n " //If connection failed
} else {
echo "Connected successfully \n " ;
sasql_close ( $conn ) ;
}
}
?> |
Copyright 2011 iAnywhere Solutions, Inc. All rights reserved. This sample
code is provided AS IS, without warranty or liability of any kind.
|